package main

// TCP 客户端，测试缓存服务的基本功能

import (
	"github.com/GoDistributedCacheFramework/src/cacheClient"
	"flag"
	"fmt"
)

func main()  {
	server := flag.String("h","localhost","cache server address")
	op := flag.String("c","get","command, could be get/set/del")
	key := flag.String("k","","key")
	value := flag.String("v","","value")
	flag.Parse()	// 解析命令行
	client := cacheClient.New("tcp",*server)
	cmd := &cacheClient.Cmd{*op,*key,*value,nil}
	client.Run(cmd)
	if cmd.Error != nil {
		fmt.Println("error:",cmd.Error)
	} else {
		fmt.Println(cmd.Value)
	}
}




